﻿#ifndef _CFEATURE_ITERATOR_H_H_
#define _CFEATURE_ITERATOR_H_H_
#include "udatabase/dll_cfg.h"
#include "udatabase\interface\ifeatureiterator.h"
#include "udatabase\spatialDB\fields.h"
#include "udatabase\spatialDB\queryfilter.h"
#include "udatabase\geodb\vectorfeatureclass.h"
#include "graphicengine/OgreCommon.h"


namespace FD{
	namespace Utility{
		namespace DB{
/// <summary>
/// 二维矢量要素迭代器
/// </summary>
class FeatureSelection;
class FD_DB_Export CFeatureIterator : public FD::Utility::DB::Interface::IFeatureIterator
{
	friend class FeatureSelection;
	friend class CVectorFeatureClass;
public:
	/// <summary>
	/// 默认析构函数
	/// </summary>
	virtual ~CFeatureIterator();
public:
	/// <summary>
	/// 获取下一条记录
	/// </summary>
	/// <param name=""></param>
	/// <returns>返回要素</returns>
	virtual FD::Utility::DB::Interface::IFeature* next();
	/// <summary>
	/// 获取要素字段信息
	/// </summary>
	/// <param name=""></param>
	/// <returns>返回要素字段信息</returns>
	virtual const FD::Utility::DB::Interface::IFields* getFields() const;
	/// <summary>
	/// 通过索引获取要素某一字段信息
	/// </summary>
	/// <param name="index">索引处</param>
	/// <returns>返回要素某一字段信息</returns>
	virtual const FD::Utility::DB::Interface::IField* getField(uint32 index) const;
	/// <summary>
	/// 通过名称查找字段
	/// </summary>
	/// <param name="fieldName">字段名</param>
	/// <returns>返回查找到的字段索引</returns>
	virtual int32 findField(const String& fieldName) const;
private:
	//CFeatureIterator(FD::GraphicEngine::NameValuePairList *pList);
protected:
	CFeatureIterator(String key,CVectorFeatureClass* fc);
private:
	CFeatureIterator(CFeatureIterator & iterator);

	String						m_QueryKey;
	FD::Utility::DB::CVectorFeatureClass			*m_pFC;
	FD::Utility::DB::Interface::IFields						*m_pFieldSet;
	FD::Kernel::Geometry::Interface::IGeometry					*m_pGeometry;
	FD::Utility::DB::Interface::SpatialQueryRelationType	m_nSpatialRelation;
	FD::Utility::DB::Interface::IFeature					*m_pFeature;

	FD::Utility::DB::FeatureSelection			*m_pFSet;
	bool m_bQueryByFeatureSelection;
};



}}} //End of namespace



#endif //_CFEATURE_ITERATOR_H_H_

